#include-once
#include '..\Editors.au3'
#include '..\UDFs\ScintillaExt.au3'

Global Const $gzEDITORS_IDGENERAL = _Editors_Register('General Text Editor', _
			Default, __GeneralTextEditor_MessageHandler, __GeneralTextEditor_NotifyHandler)

Local $__gGeneralTextEditor_hWnd = 0

Func __GeneralTextEditor_MessageHandler($uMsg, $vParam, ByRef $rParam)
	Switch $uMsg
		Case $gnEDITORS_EM_POSTREGISTER	;$gnEDITORS_EM_POSTREGISTER, $zEditorId
			__GeneralTextEditor_LoadPropertiesFiles()
		Case $gnEDITORS_EM_CREATE		;$gnEDITORS_EM_CREATE, $hParentView, $aClientSize
			$__gGeneralTextEditor_hWnd = _ScintillaExt_Create($hParentView, _
						$aClientSize[0], $aClientSize[1], $aClientSize[2], $aClientSize[3])
		Case $gnEDITORS_EM_DESTROY		;$gnEDITORS_EM_DESTROY, 0, 0
			_ScintillaExt_Destroy($__gGeneralTextEditor_hWnd)
		Case $gnEDITORS_EM_ACTIVATE		;$gnEDITORS_EM_ACTIVATE, $aDocumentIds, $bSameEditor
			;$aDocumentIds[0]: New Document, $aDocumentIds[1]: Old Document

		Case $gnEDITORS_EM_DEACTIVATE	;$gnEDITORS_EM_ACTIVATE, $sDocumentId

	EndSwitch
EndFunc

Func __GeneralTextEditor_NotifyHandler($uCode, $vParam, ByRef $rParam)
	Switch $uCode

	EndSwitch
EndFunc

Func __GeneralTextEditor_LoadPropertiesFiles()
	Local $idFirstPropsFile = FileFindFirstFile('Properties\*.properties')
	If $idFirstPropsFile = -1 Then Return

	Local $sNextPropsFile = ""

    While 1
        $sNextPropsFile = FileFindNextFile($idFirstPropsFile)
        If @error Then ExitLoop
        __GeneralTextEditor_ParseProperties($sNextPropsFile)
    WEnd
EndFunc

Func __GeneralTextEditor_ParseProperties($sPropertiesFile)

EndFunc